/* ====================================================================
 * (#)Header: GenericPersonServiceImpl.java
 * (#)Revision: 
 * (#)Date Created: Mar 3, 2007 2:07:44 AM
 * (#)Created By: Karol Wozniak
 * ====================================================================
 *
 * Copyright (c) 2007 karolak .  All rights reserved.
 *
 * ====================================================================
 * 
 * The software application represented here is the sole property of 
 * karolak. Its unauthorized utilization is expressly prohibited.
 * 
 * ====================================================================
 */

package com.karolak.service.entity;

import java.util.List;

import com.karolak.entity.Person;
import com.karolak.query.Criterias;
import com.karolak.service.entity.GenericPersonService;

/**
 * 
 * <code>GenericPersonServiceImpl</code> is ....
 * 
 * @param <T>
 * @author <a href="mailto:kwozniak@hotmail.com">Karol Wozniak</a>
 */
public class GenericPersonServiceImpl<T extends Person> extends EntityServiceImpl<T, Integer> implements GenericPersonService<T> {

	public GenericPersonServiceImpl(Class<T> persistentClass) {
		super(persistentClass);
	}

	public List<T> selectByFirstName(String firstName) {
		Criterias criterias = new Criterias();
		criterias.add("firstName", "=", firstName);
		return select(criterias);
	}

	public List<T> selectByLastName(String lastName) {
		Criterias criterias = new Criterias();
		criterias.add("lastName", "=", lastName);
		return select(criterias);
	}

	public List<T> selectByEmailAddress(String emailAddress) {
		Criterias criterias = new Criterias();
		criterias.add("emailAddress", "=", emailAddress);
		return select(criterias);
	}
}
